#{extends 'CRUD/layout.html' /}
#{set title:messages.get('medicationDetail.add') /}

<div id="crudBlank" class="${type.name}">

    <h2 id="crudBlankTitle">&{'medicationDetail.add'}</h2>

    <div class="objectForm">
    #{form action:@create(), enctype:'multipart/form-data'}
        #{crud.form fields:['medicationDetailName', 'medication', 'insertions']}
        	#{crud.custom 'insertions'}
        		<label for="${insertions}">&{'insertions'}</label>
        		<select id="${insertionsSelector}" multiple="yes" name="object.insertions.insertionId" style="min-width: 280px;">
        			#{list items:models.Insertion.findAll(), as:'insertion'}
        				<option value=${insertion.insertionId}>${insertion.insertionName}</option>
        			#{/list}
        		</select>
        	#{/crud.custom}
        #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
            <input type="submit" name="_saveAndAddAnother" value="&{'crud.saveAndAddAnother', type.modelName}" />
        </p>
    #{/form}
    </div>

</div>